How does the given Java code generate all permutations of a string

welcome to shbcf.ru